#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author: G171117 JieJiSS

final_book = 648 / 3 # 每人最终的书是一样多的

def previous(A, B, C, n):
    r"""
    计算当前情况之前的n次交换时甲乙丙三人的书数。

    @author G171117 JieJiSS
    @date 2018/01/24
    @return str[]
    """
    A /= 2
    B /= 2
    C += A + B
    if n - 1 == 0:
        result = [A, B, C]
        result.sort(reverse=True)
        return list(map(str, map(int, result)))
    return previous(C, A, B, n - 1)

def solve(f, n):
    r"""
    封装previous函数，简化接口
    """
    return previous(f, f, f, n)

print("三人最开始的书数：", ", ".join(solve(final_book, 3)), sep='')
